home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
tools
/
czesc_3
/
multiuser
/
extern
/
netmufs1.1
/
debug
/
debuglib.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-07
|
1KB
|
58 lines
/*
** $VER: debuglib.c 1.0 (07.02.94)
**
** debug.library functions
**
** © Copyright 1994 by Norbert Püschel
** All Rights Reserved
*/
#include <proto/exec.h>
#include <proto/dos.h>
#include <dos/dostags.h>
#include <string.h>
struct DosLibrary *DOSBase;
struct SignalSemaphore S;
BOOL __saveds __asm LIBGlobalAlloc(register __d0 struct Library *Base)
{
DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",37);
if(DOSBase) {
memset(&S,0,sizeof(struct SignalSemaphore));
InitSemaphore(&S);
return(TRUE);
}
return(FALSE);
}
BOOL __saveds __asm LIBGlobalFree(register __d0 struct Library *Base)
{
CloseLibrary((struct Library *)DOSBase);
return(TRUE);
}
void __saveds __asm LIBDEBUGA(register __d1 STRPTR fname,
register __d2 STRPTR format,
register __d3 LONG *args)
{
BPTR file;
ObtainSemaphore(&S);
file = Open(fname,MODE_READWRITE);
if(file) {
Seek(file,0,OFFSET_END);
VFPrintf(file,format,args);
Close(file);
}
ReleaseSemaphore(&S);
}